define(function () {
    'use strict';

    function ctrl($scope, WebService) {

        $scope.$on('$ionicView.beforeEnter', function () {
            init();
        });

        function init() {
            var econtract_type = '1';
            WebService.getEncontractList(econtract_type).then(
                function (data) {
                    if (data && data.length > 0) {
                        $scope.agreementList = data;
                    }
                });
        }
    }

    ctrl.$inject = ['$scope', 'WebService'];
    return ctrl;
});
